package com.ly.controller;

import com.ly.entity.BankAccount;
import com.ly.service.AccountService;
import com.ly.service.impl.AccountServiceImpl;
import com.ly.utils.IOUtil;
import com.ly.utils.Menu;

import java.io.IOException;

/**
 * Author: LiYao
 * CreateTime: 2025-03-11 19:35
 * Description:
 * Version: 1.0
 */
public class AccountController {


    public BankAccount login() {
        AccountService accountService = new AccountServiceImpl();
        String accountID = IOUtil.getInput("请输入账号：");
        String password = IOUtil.getInput("请输入密码：");
        BankAccount AccountFlag = accountService.login(accountID, password);
        if (AccountFlag!=null) {
            System.out.println("登录成功！");
            return AccountFlag;
        } else {
            System.out.println("登录失败！");
            return null;
        }
    }





}




